/**      
 * @file		improvedCharacterCodes.cpp
 * @description		This program takes user input as a character
 *			checks the character to see if it is a lowercase
 *			letter, if it is, the program converts that
 *			letter to an uppercase character and repeats
 *			the process until the user doesn't want to 
 *			convert characters to uppercase.
 * @course		CSCI 123 Section 00000
 * @assignment		Lecture 4 - Sample 9
 * @date		mm/dd/yyyy	
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		2.0
 */
#include <iostream>
#include <cctype>
using namespace std;

/**
 * @return zero if the application executes successfully
 */
int main() {
	char theChar = '1';	

	while(theChar != '0') {
		cout << "Please type a lowercase character ";
		cout << "and I will make it uppercase.\n";

		cin >> theChar;
		
		// islower returns 1 if the character is a lowercase
		// letter and 0 if it is not
		if(!islower(theChar)) {
			cout << "You've typed an invalid character!\n";
			cout << "Please try again\n";
			continue;
		}
		
	    	cout << "You typed the character '"
		     << theChar << "'\n";
		cout << "I can capitalize the char '"
		     << static_cast<char>(toupper(theChar))
		     << "'\n";

		cout << "Would you like to continue?\n";
		cout << "Type '1' for yes and '0' for no\n";

		cin >> theChar;
	}
	return 0;
}
